UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GlV6rOAqg7bEqKmlqkNaskrOcwhm7xUCXbS2B32s450='
WHERE
key_id = 'e135eceebd7150ac4cc88f173bc5d920fa869580e9aa4a0902bc0d312d7f8bec'
AND (
token = 'GlV6rOAqg7bEqKmlqkNaskrOcwhm7xUCXbS2B32s450='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)