UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wz6rKCkSW7Rv+qGBSgtVIWm/IBu7EOJ5VTJrI0oC3do='
WHERE
key_id = '3edf6dfa4e3c3221cafa449a0f4283f9039452d5d4bf685db462872f24551296'
AND (
token = 'Wz6rKCkSW7Rv+qGBSgtVIWm/IBu7EOJ5VTJrI0oC3do='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)