UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XGvpKtISN/5QvrLdFDQCjIJPqUZ1qmCM5F8vcVXDS4U='
WHERE
key_id = '5c62dbdb06586104b221dd1ca478f0581a1c0efbf5254eb3a40b0ccb53a5e3fc'
AND (
token = 'XGvpKtISN/5QvrLdFDQCjIJPqUZ1qmCM5F8vcVXDS4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)