UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T7Xjg6rsYKwtrnkeBAOVlNLsWWVNDbVBRDLW/h1eguo='
WHERE
key_id = 'bc2950e8b523dc036bdd411747543f46c8d9ceb8965f0daa529437cae3bc9d36'
AND (
token = 'T7Xjg6rsYKwtrnkeBAOVlNLsWWVNDbVBRDLW/h1eguo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)