UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dUzuz8LdyTDdKII3nXmOXG9KmSV0pI+5R8UMyoV3XTo=' 
WHERE 
  key_id = '292243acfee0a8fd120ef016b5ea6459a4fc1b9d6721023956830a77fed8a2fd' 
  AND (
    token = 'dUzuz8LdyTDdKII3nXmOXG9KmSV0pI+5R8UMyoV3XTo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037