UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '66ysx3gyvSjLAOcQ4bHZRp3Yan12G5rWYs25jJxVva8='
WHERE
key_id = 'b8cb0676cdeb14c9dc98f83bba95b62adbac1e37ebbf394dd19a54ccfc09969b'
AND (
token = '66ysx3gyvSjLAOcQ4bHZRp3Yan12G5rWYs25jJxVva8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)