UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mxLeixLX9TL3ObP5E/dqGMeYZ5I+kcrPm8QifLruWLg='
WHERE
key_id = '056e1ea19be48b33ab44075eb41ca2fafae787f52a5cadc7c546729d5f9f5dca'
AND (
token = 'mxLeixLX9TL3ObP5E/dqGMeYZ5I+kcrPm8QifLruWLg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)