UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '767OmfuVX2QSXBCz4vIAOdsNVPgcmFgEw2XsKKDx2QE='
WHERE
key_id = '144cd4df94ab2de63fe0a403b88bd862dd0803b2423b7a0f0fda0566cd96f5e4'
AND (
token = '767OmfuVX2QSXBCz4vIAOdsNVPgcmFgEw2XsKKDx2QE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)