UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pLCMCoThEP2raBl+r4ynOFzsNfNDeX7dc+tbXHyjNtE='
WHERE
key_id = '65dcddc131f50efadda5410ccf321ca25f4435fd86f429c906cdbaa49e21f6ba'
AND (
token = 'pLCMCoThEP2raBl+r4ynOFzsNfNDeX7dc+tbXHyjNtE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)