UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L1TB+v6QyREJL5jLuHAe7SohR/LPkKg6aru51Pv/Bk0='
WHERE
key_id = '1aa406cc6a22010819f976614f0de8dfd34dd685d298ec326d8d4fc484bc68c2'
AND (
token = 'L1TB+v6QyREJL5jLuHAe7SohR/LPkKg6aru51Pv/Bk0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)