UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y9byqC1UEcElBh/rQswfS3mOYNcxOsMf0I62PfsWaOE='
WHERE
key_id = '94f51b59de4e875c09311ceb26fd985ae76d8e0e3b2d85a2d20731c4f1890fbb'
AND (
token = 'Y9byqC1UEcElBh/rQswfS3mOYNcxOsMf0I62PfsWaOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)