UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O9H45ftyeumn88nURyiVNEQZFIGe49wnvEBMXXYudRs='
WHERE
key_id = '52d5420cec552ed2b0b85a5bd7f605e7d127156837f3160c074db8e110befd85'
AND (
token = 'O9H45ftyeumn88nURyiVNEQZFIGe49wnvEBMXXYudRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)