UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YNeIXyLfQB8TOryS7ytZc40UUQI7aGobgni62LOcQz4=' 
WHERE 
  key_id = '6b595c494d2dc26e05955569c14eb471a8c01bce8f21f773f79fbdba2ed15484' 
  AND (
    token = 'YNeIXyLfQB8TOryS7ytZc40UUQI7aGobgni62LOcQz4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026