UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JFNW7I5pBZGv/FY9jvVF5jjtGa7zpC0aGNqv8fiNMNU=' 
WHERE 
  key_id = '3f4f8719ccb389e2cc9eb271fa4f085c7be54f6410510a5541fcaa987d2fb0ee' 
  AND (
    token = 'JFNW7I5pBZGv/FY9jvVF5jjtGa7zpC0aGNqv8fiNMNU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030