UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MkMXEAMLYFHjREwqnIo4tALxmLmajE33KTwCnyEZY3U='
WHERE
key_id = 'c33288c05d1b9162a508a484bd9202cb63b5aa66265e81c25ef01768d1e816ea'
AND (
token = 'MkMXEAMLYFHjREwqnIo4tALxmLmajE33KTwCnyEZY3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)