UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QmLvuwwbv+rp+6ZEQQYpWLA8JuGFg7gP4jsocDBsZVE='
WHERE
key_id = '48c2537efd4e8aa609db3467fc6327cd492a9fba45c010c10d4338a5bc281cbb'
AND (
token = 'QmLvuwwbv+rp+6ZEQQYpWLA8JuGFg7gP4jsocDBsZVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)