UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kauY5doMp+/wN2iGbVqzW5rSWKHTdIM45oc04kt5+S4=' 
WHERE 
  key_id = '4df1daf16d07d58698f9a0bb297f1a2434b096ae1a49887dc41026ff255a5a51' 
  AND (
    token = 'kauY5doMp+/wN2iGbVqzW5rSWKHTdIM45oc04kt5+S4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042