UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P92BST6oosGOkvOx/QarjGBrIHK9BWN57cjvwc08vw4=' 
WHERE 
  key_id = 'd1bf8cad0db3e07f8ed3b2d0f38a6dd8f71e1344d1059ac4fabd90b9e6782dad' 
  AND (
    token = 'P92BST6oosGOkvOx/QarjGBrIHK9BWN57cjvwc08vw4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019