UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mCr3JrqUCuASFJ+4ydlJnoXAoRj2TF7pIYN0bUACdys='
WHERE
key_id = '63bb4054d49f1852b36a6e47fe0e71455688f1a8ec7585be277eee62a6f425dc'
AND (
token = 'mCr3JrqUCuASFJ+4ydlJnoXAoRj2TF7pIYN0bUACdys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)