UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8NRoPgXaKmuopVx8RkjnZncArFPbDs6xgH9d/FiNK4Y=' 
WHERE 
  key_id = 'e53df8d1c946144b1f0710e5f29c3685cbee9ae5374b50dc4a0101eac391b67c' 
  AND (
    token = '8NRoPgXaKmuopVx8RkjnZncArFPbDs6xgH9d/FiNK4Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019