UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VStELspl0R7mpoo9MyFU9LJttZxH536TtdpiAO5i5Mg=' 
WHERE 
  key_id = 'e488212b94a9cfd4e928b67e4f0d04fc7db34586fedf0c31904d8fdcec5f9d5a' 
  AND (
    token = 'VStELspl0R7mpoo9MyFU9LJttZxH536TtdpiAO5i5Mg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037