UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BG2oALFVTv1P8ZxR/AWaYeNrRtJKbwBzb/Dl/Hs7EeQ='
WHERE
key_id = 'd5dc68170340ea7c6069a155f2c32ae919aed7b8a4d641bc32244f1d8895f652'
AND (
token = 'BG2oALFVTv1P8ZxR/AWaYeNrRtJKbwBzb/Dl/Hs7EeQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)