UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EX4XRFfrQILNcMuDzK8SxykhDtoEZ1vOkxZRfiq7PFo='
WHERE
key_id = '469a03eaf8c77eaa0f3ad15742c8c1ee969d9ca4e5a50dd3ed872b7a5ed4f29e'
AND (
token = 'EX4XRFfrQILNcMuDzK8SxykhDtoEZ1vOkxZRfiq7PFo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)