UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3yYkEPvovDMfBMCM56mnKCU68q4QgsBPgo/MwNUOrC4='
WHERE
key_id = '03ea55216d2bc2007c3d7f677b390c56212ef06568a21003ba636267df4a3b64'
AND (
token = '3yYkEPvovDMfBMCM56mnKCU68q4QgsBPgo/MwNUOrC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)