UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y9y3VmddGek06AoxsO3JccTRuBnP7O+x0fGPh5urYDI='
WHERE
key_id = 'e44e35b492073ef05e72842121e5cd9766749f4fd282a38ac7e459fbc6d019f6'
AND (
token = 'y9y3VmddGek06AoxsO3JccTRuBnP7O+x0fGPh5urYDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)