UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aCtSstlu8CvWRZUNgptYa4Mx9CeapaAiLWBT6eAxCq0='
WHERE
key_id = '53b634d86b86e776c0e64494ac091c72dfbc413ebfb2417d55eed8c9fbc0a47d'
AND (
token = 'aCtSstlu8CvWRZUNgptYa4Mx9CeapaAiLWBT6eAxCq0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)