UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1vHjlLz36+4LsnL3FPXrI7XO1GiBJwsPeZ0SJbFvQrE=' 
WHERE 
  key_id = 'b3964743dd98b7fe1810e87ca662de06e174b1627441b42e61ecc542171f9bf8' 
  AND (
    token = '1vHjlLz36+4LsnL3FPXrI7XO1GiBJwsPeZ0SJbFvQrE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031