UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9aTddDjcNlGwgGgDZx3Q28EcqILom6tBCkZaoSXiQZI=' 
WHERE 
  key_id = 'e5b24f90b08d42120b8304b010be9ced7c5f99dcfd20b1490f7a17aee529d3e7' 
  AND (
    token = '9aTddDjcNlGwgGgDZx3Q28EcqILom6tBCkZaoSXiQZI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040