UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5vj+EbSF/VPtjiZvPWrBeMhlgiaiZaZ2a2eTxo9Klxc='
WHERE
key_id = '83d507225a1fea7ab62445a25369e3ff228ee6fb798ccd57ab66c34699a7c79c'
AND (
token = '5vj+EbSF/VPtjiZvPWrBeMhlgiaiZaZ2a2eTxo9Klxc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)