UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vADUfOYdtC+PqpnNqltRQ57XHDrejAwy9tBFG12/Ps0='
WHERE
key_id = '49995b82078d426055472052e5a26e84c5a77fa2dda897301cbb2b2d21280b42'
AND (
token = 'vADUfOYdtC+PqpnNqltRQ57XHDrejAwy9tBFG12/Ps0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)