UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xEX3iC5MIROEwDAgjpxh5VksKEi91onnqc6BZZ3ORcg=' 
WHERE 
  key_id = 'ab1a83b508cb1f2b5e598531e74043e71e55a6ebffcf29118220508a7b2d55c9' 
  AND (
    token = 'xEX3iC5MIROEwDAgjpxh5VksKEi91onnqc6BZZ3ORcg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029